home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / Documentation / Development Notes / ODF Examples RoadMap / Window Management < prev   
Encoding:
Text File  |  1996-04-26  |  3.8 KB  |  51 lines  |  [TEXT/ttxt]

  1. OpenDoc
  2. Development
  3. Framework
  4.                                                                                                                                                                                      
  5. Window Management
  6. ODF Release 1                                                                                                                                                             
  7.  
  8.  
  9. Table of Contents
  10. ------------------------
  11. • Floating Windows - ODFDraw
  12. • Zoom - ODFBitmap
  13. • Minimum and Maximum Size - ODFDraw 
  14. • Changing the Size and Style of the Document Window- ODFDraw -ODFBitmap
  15. • Changing the Size and Style of the Part Window
  16.  
  17.  
  18. Floating Windows
  19.  
  20. ODFDraw: In CDrawPart::Initialize the palette presentations are registered and then the three FW_CFloatingWindow objects are created (CDrawPart::InitializePalettes). Note that the platform window and frame will only be created when the window is shown for the first time. In CDrawPart::DoMenu the requested palette is shown by calling FW_CFloatingWindow::ShowHide. Showing the palette will trigger the creation of the frame (CDrawPart::NewFrame). Notice also here that because floating windows are shared among parts with the same editor in the same document your NewFrame method could be called multiple times to create a frame you have in fact already created. You need to keep track of that by keeping a pointer to your frame and returning it instead of creating a brand new one. Finally when your part goes away delete your floating window objects (CDrawPart::ReleaseAll).
  21.  
  22. Zoom
  23.  
  24. Your root frame's AdjustZoomedWindowSize method will be called when the user clicks on the window zoom box. The size of the main screen is used to calculate the suggested size (this is the inside size of the window). If your part does not want to zoom full screen it can change the suggested size by overriding AdjustZoomedWindowSize.
  25.  
  26. ODFBitmap: look at CBitmapFrame::AdjustZoomedWindowSize. The suggested size is set to the size of the bitmap plus a 10 pixel border. 
  27.  
  28.  
  29. Minimum and Maximum Size
  30.  
  31. Your root frame's AdjustWindowGrowLimits method will be called when the user resizes one of your windows.  AdjustWindowGrowLimits has two parameters: minSize and maxSize. When calling AdjustWindowGrowLimits ODF passes a suggested minimumsize of (64, 64) and a suggested maximum size of (32000, 32000). 
  32.  
  33. ODFDraw: look at CDrawFrame::AdjustWindowGrowLimits. The maximum size is left untouched but the minimum size is changed to (72, 72) plus the size of the ruler (if present) and the size of the scrollbars.
  34.  
  35.  
  36. Changing the Size and Style of the Document Window
  37.  
  38. When your part editor is the root of the document, ODF calls the method FW_CPart::NewDocumentWindow to create the document window. The default implementation creates a standard document the size of the main screen. If you want to change the default size and style you need to override NewDocumentWindow. 
  39.  
  40. ODFDraw: look at CDrawPart::NewDocumentWindow. The window size is calculated using the size of the document. The window position is determined using the screen bounds top left corner. 
  41.  
  42. ODFBitmap: look at CBitmapPart::NewDocumentWindow. The window size is calculated using the bitmap bounds. The window position is calculated the same way as ODFDraw by using the top left corner of the screen bounds.
  43.  
  44.  
  45. Changing the Size and Style of the Part Window
  46.  
  47. A part window is a window created as a result of a command like: “View In Window”. Your frame's NewPartWindow method is called to create the FW_CWindow object. To change the position, size, or style of this window override FW_CFrame::NewPartWindow. None of the ODF samples currently overrides NewPartWindow. 
  48.  
  49.  
  50. © 1993 - 1996 Apple Computer, Inc. All rights reserved.
  51. Apple, the Apple Logo, Macintosh, and OpenDoc are trademarks of Apple Computer, Inc., registered in the United States and other countries.